home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_c
/
cug103
/
help.edi
< prev
next >
Wrap
Text File
|
1985-03-10
|
11KB
|
356 lines
THis is a HELP file for Scott and Neal's QED editor in BDS C.
When in EDIT itself, you can get a brief listing of all commands by
using the "h" command, but here I've tried to give a bit more explan-
ation, and a few examples. In what follows, whenever I say "range"
of lines, I mean two numbers separated by a comma, like 4,20 .
If you are doing something over a range of lines (search, subs.,
print, whatever ) and you want to stop, just hit a <cr>.
Whenever you make a change while EDITing, the line numbers
are automatically readjusted as necessary - so check them out after
any changes that rearrange lines, unless you like surprises......
To get into this program and get this WITTY message, just type
"help", OR to get help for one particular item type "help item".
Since you're here already just type one of the following menu
selections. My arbitrary division of the command types may seem
rather tacky to some people (like neal and scott) but hey, that's
life. (this file created May 7, 1981 by Kathy Bacon )
$$
$MISC$
$LINE$
$FILE$
$PRINT$
$SEARCH$
$ $
$ THAT'S ALL $
$$
$MISC$
********************************************************************
Miscellaneous Commands
********************************************************************
A dollar sign ($) stands for the last line of the file.
A period or dot (.) stands for the current line.
COMMAND DESCRIPTION
Control-P Everything shown thereafter will be sent to the
printer; to stop type another Control-P.
h Will list a brief description of all commands
u This is the "user-defined-command". To set it, you
just say u=com and u is set equal to "com".
"com" can be anything you want - a complicated
search-and-substitute you'll be doing a lot,
a ".,$" , or whatever.
don't touch that dial! but do hit <cr>
$$$
COMMAND DESCRIPTION
# Toggles the line numbers on or off.
< Turns the prompts on.
> Turns the prompts off.
= Has various uses:
f=file sets default filename to "file"
$= tells you last line number
.= tells you current line number (useful if
you've turned off the numbers)
u=com sets the user command to "com"
u= tells you what the user command is
$FILE$
***************************************************************
Commands Concerning Files
***************************************************************
I know, I know, they're ALL concerned with files, but read on...
COMMAND
r x:filename Reads in file "filename" from drive x. The default
is the currently logged in disk if no designation
is given.
w x:filename Writes "filename" to disk x. Again, "x" is optional.
So, for that matter, is the filename: if you don't
specify, it will use the current default filename
(there is a default even if you've never specified
one during your EDITing - it USED to write out a
file with the descriptive title of " ", which,
although it saves TYPING, is really not cool...)
beat <cr> for more of this witty text !!!!!
$$$
f Tells you the current default filename.
f=file Sets the default filename to "file".
q Quits the editor. If you try to quit without first
writing the file (via "w") to disk, EDIT will scream
(well, ACTUALLY it will only BEEP) at you. If you
don't want your most recent changes anyway, and you
find this behavior obnoxious, read on...
q! Quits quietly.
n x:file Will read a file of EDIT commands, "file", from drive
x and use it to EDIT the file you are in.
This can be used to add all or part of a file to
another (there's no explicit command for this ).
Copy the text you want to add into a file, precede
it with an 'a' for append, follow the text with a
period, and then use the file to EDIT the file you
want to add the text to.
If you don't specify a file name, EDIT will use
the current default file name, which will most
likely NOT contain EDIT commands....
$LINE$
****************************************************************
Commands Concerning Lines
****************************************************************
To move to a particular line, just type it's number.
To print a range of lines, type the range.
(line#)a APPENDS lines of text AFTER the (optional) line
number. To stop, type a single period (.) on a line.
(line#)ac APPEND COMMENT to (line#). This will add a /* at
the end of (line#); you type in the text of your
comment, and then it fills in the closing */ .
(range)c CHANGES the line or lines specified. To stop, type
a single period on a line.
(range)d DELETES the line or range of lines specified.
(line#)i INSERTS lines of text BEFORE the (opt.) line
number. To stop, type a single period (.) on a
line.
!!!!! club <cr> to continue !!!!!!
$$$
(line#)j JOINS the line following "line#" to the end
of "line#", making the two one line.
(range)m(dest) Moves the range of lines specified to the
destination specified. They are deleted from
their original location.
(range)t(dest) Copies the range of lines specified to the
destination specified. The lines are NOT
deleted form their original location.
hit <cr> for an example of "m" and "t"
$$$
Example:
141>a
142 line one of ridiculous text
143 line two la dee da dee da
144 third boring line
145 fourth insipid line
146 boring boring boring
147 .
146>142,143m146
146>142,146
142 third boring line
143 fourth insipid line
144 line one of ridiculous text
145 line two la dee da dee da
146 boring boring boring
146>146t142
146>142,147
142 boring boring boring
143 third boring line
144 fourth insipid line
145 line one of ridiculous text
146 line two la dee da dee da
147 boring boring boring
$PRINT$
***********************************************************
Print Commands
***********************************************************
All line number designations for these commands are OPTIONAL.
--------------------------------------------------
^ An up-arrow = .,$ , printing from the current
line to the last line of the file. This is useful
because just hitting a key will stop it, so you
can look at an indefinite range of code.
(range) Will print the range of lines, and set dot to
the last line in the range.
(line#)p Displays the line designated, and sets dot (.) to
"line#".
(range)l Displays the range with all control characters
shown as an up-arrow followed by a letter. The
only control character this editor will let you
insert is a tab (^I) but other sneaky little
beasties may creep in.
"hit me! hit me!..." said the masochistic <cr>.......
$$$
(line#): Prints from (line#) to (line# + 16); sets dot equal
to (line#).
(line#)& Prints from (line# - 16) to (line#), leaves dot at
(line#).
(line#)" Prints from (line# + 1) up to (line# + 17), leaves
dot at (line#).
(line#)~ Prints from (line# - 16) up to (line#), sets dot
to (line# - 16).
(line#)% Prints from (line# - 8) up to (line# + 8) to
show the context of a line.
$SEARCH$
*****************************************************************
Search and Substitute Commands
*****************************************************************
These come in several flavors.....depending on your tastes...
The General "Searches":
----------------------
/string/ Will search FORWARD through the file for the next
occurrence of "string", and print it out.
?string? Will search BACKWARD through the file for the last
occurrence of "string". A "print" is implied.
g/string/ Will search and print out all occurrences of
"string" in the file.
v/string/ Will print out all lines in the file which DO
NOT contain "string".
more delicacies to come if you hit <cr>...
$$$
The "Search and Substitutes":
---------------------------
(range)s/search/replace/ Will substitute "replace" for the
FIRST occurrence of "search" on all
lines in "range".
(range)s/search/replace/p Will do the same, but will print the
final result.
(range)s/search/replace/gp Will substitute for ALL occurrences
on each line.
and for the sophisticated palate....... (hit <cr>)
$$$
The "Interactive Substitute":
----------------------------
(range)x/search/replace/p Will search and print out each
occurrence of "search" in "range",
and wait for a response - if you
reply with a <cr>, it will NOT
do the substitution; if you reply
with a ".", it will do the subs.
and print the result.
A "/" is generally used to delimit the search and replace
strings, but another character can be used, like a "@".
you probably know what to do by now...
$$$
There are also some "special characters" that can appear in
these "search" and "replace" strings:
CHARACTER MEANING
& In a "replace" string, "&" stands for the string
you just searched for.
$ In a "search" string, stands for the end-of-line.
^ Stands for the beginning-of-line.
* Zero, one, or many of the character immediately
following it.
more characters to come.......club beat mangle <cr>
$$$
. A "wild-card": any character.
~ "not" character: a match will occur for anything
EXCEPT the character immediately following the "~".
You could try to find "th~is", for example. This
is especially useful if you're a lousy speller.
\ The "force" character: if you want to actually
look for a string containing one of these special
characters, precede it with a "\" to "force" it
into the string.
hit that <cr> for more enlightenment (ZEN programming...)
$$$
Some Example Substitutions:
--------------------------
309>a
310 I think I am losing my mind.
311 .
310>s/t*.n/am so bore/p
310 I am so bored.
310>s/so/& & & /p
310 I am so so so bored.
310>a
311
312 snore (snooze) /* a boring function */
313 .
312>s/(*~)/&,fizzle/p
312 snore (snooze, fizzle) /* a boring function */
312>s//&,zzzzz/p
312 snore (snooze, fizzle, zzzzz) /* a boring function */
312>
The combination "*." stands for any number of any character. Note
that it matches the LONGEST occurrence of the search string. This
is useful, but can be tricky if you're not careful.
Notice also that it will remember the last search string
if you just say //
$ $
$$
thats all folks!!!!
$$%
????
$$%
$$
t will remember the last search string